$(function () {
    obj.init();
});

var obj = new function () {
    'use strict';
    return {
        dataGrid: null,
        params: {
            schoolId: null
        },
        init: function () {
            this.dataGrid = new xhDataGrid($('#list'), 'school/getPoorStudent');
            this.dataGrid.parseToolbar().init();
            xhTool.bindDocKeyDown($('#bt_list_search'));
            this.listener();
        },
        listener: function () {
            var $this = this;
            // 绑定搜索事件
            $('#bt_list_search').click(function () {
                $this.funObj().search();
            });
        },
        funObj: function () {
            var $this = this;
            return {
                repairApply: function (level) {
                    var titles = '申请贫困生';
                    var height = 400;
                    window.top.xhTop.showModal({
                        title: titles,
                        content: xhTool.getFrameString('school_apply/addStudentApply', {level: level}, height),
                        button: '保存',
                        size: 'sm',
                        width:'500',
                        backClose: false
                    });
                },

                // 查找
                search:function () {
                    var key = xhExtra.getValue($('#list_search'));
                    var iPoorLevel = $('#list_type').combobox('getValue');
                    $this.dataGrid.reload({key:key , poorLevel: iPoorLevel});
                },
            }
        }
    }
};